<?php 
$this->widget('ext.innerfade.innerfadeWidget',array(
	'id'=>'#news'
));
//$dataProvider = json_decode($dataProvider);

?>
<script type="text/javascript">
<!--
$(function(){
	$("#headerleftCategory").find("h2").empty();
	$("#headerleftFolder").empty();
	$("#headerleftRecommendContent").find("p").empty();
	$("#headerleftRecommendContent").find("h3").empty();	

});

function showRecommendItem(){
	var i = parseInt($("#hideNum").val());
	
	var data = {"bindings":<?php echo $dataProvider;?>};
	var category = data.bindings[i].category?data.bindings[i].category:'No Category';

	category = category.substr(0,2)+'<br /><span>'+category.substr(2,4)+'</span>';

	var folder = data.bindings[i].folder;
	var title = data.bindings[i].title;
	var content = data.bindings[i].content;
	var links = data.bindings[i].links;

	$("#headerleftContent").fadeOut('slow')

	$("#headerleftCategory").find("h2").html(category);
	$("#headerleftFolder").html(folder);
	$("#headerleftRecommendContent").find("p").html(content);
	$("#headerleftRecommendContent").find("h3").html(title);

	$("#headerleftContent").fadeIn('slow');
	
	i++;

	if(i > data.bindings.length-1){
		i = 0;
	}
	$("#hideNum").val(i);
}
window.setInterval("showRecommendItem()",5000);

//-->
</script>

